package com.example.easy.mapper;


import com.example.easy.Dto.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;


public interface UserMapper {

    @Select("SELECT user_psd FROM user  WHERE user_name=#{user_name} ")
    String selectPsd(String user_name);

    @Select("SELECT * FROM user  WHERE user_id=#{user_id} ")
    User selectall(String user_id);

    @Select("SELECT user_name FROM user  WHERE user_name=#{user_id} ")
    String selectUid (String user_id);

    @Insert("Insert into user (user_name,user_psd,email,sex,phone)Values(#{user_name},#{user_psd},#{email},#{sex},#{phone})")
    void  insUser(User u );

    @Update("UPDATE user  SET email=#{email},sex=#{sex},phone=#{phone} WHERE user_name=#{user_name}")
    void update (User u);
}
